﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.auth.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.auth.dao.*;
import com.hh.bss.auth.entity.*;
import com.hh.bss.auth.service.*;
import com.hh.bss.auth.vo.query.*;
import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.util.*;





public class SystemBranchCompany extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "SystemBranchCompany";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_BRANCH_NBR = "branchNbr";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_ADDRESS = "address";
	public static final String ALIAS_TEL = "tel";
	public static final String ALIAS_FAX = "fax";
	public static final String ALIAS_POSTCODE = "postcode";
	public static final String ALIAS_BANK = "bank";
	public static final String ALIAS_ACCOUNT_NAME = "accountName";
	public static final String ALIAS_ACCOUNT_NO = "accountNo";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	
	//date formats
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotBlank @Length(max=10)
	private java.lang.String branchNbr;
	@NotBlank @Length(max=200)
	private java.lang.String name;
	@Length(max=100)
	private java.lang.String address;
	@Length(max=20)
	private java.lang.String tel;
	@Length(max=20)
	private java.lang.String fax;
	@Length(max=6)
	private java.lang.String postcode;
	@Length(max=200)
	private java.lang.String bank;
	@Length(max=200)
	private java.lang.String accountName;
	@Length(max=50)
	private java.lang.String accountNo;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	
	private java.util.Date modifiedDt;
	private java.lang.Integer parentId;
	//columns END

	public java.lang.Integer getParentId() {
		return parentId;
	}

	public void setParentId(java.lang.Integer parentId) {
		this.parentId = parentId;
	}

	public SystemBranchCompany(){
	}

	public SystemBranchCompany(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setBranchNbr(java.lang.String value) {
		this.branchNbr = value;
	}
	
	public java.lang.String getBranchNbr() {
		return this.branchNbr;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setAddress(java.lang.String value) {
		this.address = value;
	}
	
	public java.lang.String getAddress() {
		return this.address;
	}
	public void setTel(java.lang.String value) {
		this.tel = value;
	}
	
	public java.lang.String getTel() {
		return this.tel;
	}
	public void setFax(java.lang.String value) {
		this.fax = value;
	}
	
	public java.lang.String getFax() {
		return this.fax;
	}
	public void setPostcode(java.lang.String value) {
		this.postcode = value;
	}
	
	public java.lang.String getPostcode() {
		return this.postcode;
	}
	public void setBank(java.lang.String value) {
		this.bank = value;
	}
	
	public java.lang.String getBank() {
		return this.bank;
	}
	public void setAccountName(java.lang.String value) {
		this.accountName = value;
	}
	
	public java.lang.String getAccountName() {
		return this.accountName;
	}
	public void setAccountNo(java.lang.String value) {
		this.accountNo = value;
	}
	
	public java.lang.String getAccountNo() {
		return this.accountNo;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("BranchNbr",getBranchNbr())
			.append("Name",getName())
			.append("Address",getAddress())
			.append("Tel",getTel())
			.append("Fax",getFax())
			.append("Postcode",getPostcode())
			.append("Bank",getBank())
			.append("AccountName",getAccountName())
			.append("AccountNo",getAccountNo())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SystemBranchCompany == false) return false;
		if(this == obj) return true;
		SystemBranchCompany other = (SystemBranchCompany)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

